namespace :counter_cache do
  desc "update matche counter cache"
  task :matches=>:environment do
    Match.all.each do |match|
      match.bets_count = match.bets.count
      match.save false
    end
  end
end
